package com.usian.service;

import com.usian.dao.DeptMapper;
import com.usian.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptService {
    @Autowired
    private DeptMapper deptMapper;

    public void addDept(Dept dept) {
        deptMapper.addDept(dept);
    }

    public void deleteDept(Integer id) {
        deptMapper.deleteByPrimaryKey(id);
    }

    public Dept findByDept(Integer id) {
        return deptMapper.findByDept(id);
    }

    public void upDept(Dept dept) {
        deptMapper.updateByPrimaryKey(dept);
    }

    public List<Dept> findByDepts() {
      return   deptMapper.findAll();
    }

}
